package com.aspose.cells.a.d;

public class zft {
   private zfj a = new zfj();
   private zfj b = new zfj();
   private zfq c;

   public zft(zfq var1, boolean var2) {
      this.c = var1;
      if (!var1.x() && !var2) {
         this.a('\uffff');
      } else {
         this.b();
      }

   }

   public int a(char var1) {
      Object var3 = this.a.e(var1);
      int var2;
      if (var3 != null) {
         var2 = (Integer)var3;
      } else {
         zfu var4 = this.c.f().b(var1);
         if (var4.c() == 0) {
            return -1;
         }

         var3 = this.b.e(var4.b());
         if (var3 != null) {
            var2 = (Integer)var3;
            this.a.a(var1, var2);
         } else {
            var2 = this.b.a();
            this.b.a(var4.b(), var2);
            this.a.a(var1, var2);
         }
      }

      return var2;
   }

   public void a(com.aspose.cells.b.a.d.zm var1, boolean var2, boolean var3) throws Exception {
      zfs var4 = new zfs(false);

      try {
         var4.a(this.c, this.a, this.b, var1, var2, var3);
      } catch (Exception var6) {
         var4.a(this.c, this.a, this.b, var1, var2, true);
      }

   }

   public zfq a() {
      return this.c;
   }

   private void b() {
      int var1 = this.c.n().d / 2;

      for(int var2 = 0; var2 < var1; ++var2) {
         int var3 = this.c.n().i[var2];
         int var4 = this.c.n().h[var2];

         for(int var5 = var3; var5 <= var4; ++var5) {
            char var6 = (char)var5;
            zfu var7 = this.c.f().b(var6);
            this.a.a(var6, var7.b());
         }
      }

   }
}
